//
//  ZLFTabbarViewController.swift
//  ZLFXYF_Swift
//
//  Created by zluof on 16/12/5.
//  Copyright © 2016年 zluof. All rights reserved.
//

import UIKit

class ZLFTabbarViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        setTabbar(ZLFHomeViewController(), selectImage: "frg_index_select", nomaelImage: "frg_index_nomal")
        setTabbar(ZLFOrderViewController(), selectImage: "frg_order_select", nomaelImage: "frg_order_nomal")
        setTabbar(ZLFMyViewController(), selectImage: "frg_mine_select", nomaelImage: "frg_mine_normal")
    
        UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(object:UIColor(red:83/255.0 ,green:204/255.0 ,blue:237/255.0, alpha:1), forKey:NSForegroundColorAttributeName as NSCopying) as? [String : AnyObject], for:UIControlState());

    }

    func setTabbar(_ controller :UIViewController,selectImage:String,nomaelImage: String){
        controller.tabBarItem.selectedImage = UIImage.init(named: selectImage)
        controller.tabBarItem.image = UIImage.init(named: nomaelImage)
        let nav = ZLFNavigationController(rootViewController:controller)
        self.addChildViewController(nav)

    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
